﻿
@{
    ViewBag.Title = "ComposeEmail";
}

<div class="wrapper wrapper-content">
    <div class="row">
        @*<div class="col-lg-3">
            <div class="ibox float-e-margins">
                <div class="ibox-content mailbox-content">
                    <div class="file-manager">
                        <a class="btn btn-block btn-primary compose-mail" href="@Url.Action("ComposeEmail", "Mailbox")">Compose Mail</a>
                        <div class="space-25"></div>
                        <h5>Folders</h5>
                        <ul class="folder-list m-b-md" style="padding: 0">
                            <li><a href="@Url.Action("Inbox", "Mailbox")"> <i class="fa fa-inbox "></i> Inbox <span class="label label-warning pull-right">16</span> </a></li>
                            <li><a href="@Url.Action("Inbox", "Mailbox")"> <i class="fa fa-envelope-o"></i> Send Mail</a></li>
                            <li><a href="@Url.Action("Inbox", "Mailbox")"> <i class="fa fa-certificate"></i> Important</a></li>
                            <li><a href="@Url.Action("Inbox", "Mailbox")"> <i class="fa fa-file-text-o"></i> Drafts <span class="label label-danger pull-right">2</span></a></li>
                            <li><a href="@Url.Action("Inbox", "Mailbox")"> <i class="fa fa-trash-o"></i> Trash</a></li>
                        </ul>
                        <h5>Categories</h5>
                        <ul class="category-list" style="padding: 0">
                            <li><a href="#"> <i class="fa fa-circle text-navy"></i> Work </a></li>
                            <li><a href="#"> <i class="fa fa-circle text-danger"></i> Documents</a></li>
                            <li><a href="#"> <i class="fa fa-circle text-primary"></i> Social</a></li>
                            <li><a href="#"> <i class="fa fa-circle text-info"></i> Advertising</a></li>
                            <li><a href="#"> <i class="fa fa-circle text-warning"></i> Clients</a></li>
                        </ul>

                        <h5 class="tag-title">Labels</h5>
                        <ul class="tag-list" style="padding: 0">
                            <li><a href=""><i class="fa fa-tag"></i> Family</a></li>
                            <li><a href=""><i class="fa fa-tag"></i> Work</a></li>
                            <li><a href=""><i class="fa fa-tag"></i> Home</a></li>
                            <li><a href=""><i class="fa fa-tag"></i> Children</a></li>
                            <li><a href=""><i class="fa fa-tag"></i> Holidays</a></li>
                            <li><a href=""><i class="fa fa-tag"></i> Music</a></li>
                            <li><a href=""><i class="fa fa-tag"></i> Photography</a></li>
                            <li><a href=""><i class="fa fa-tag"></i> Film</a></li>
                        </ul>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>*@
        <div class="col-lg-12 animated fadeInRight">
            <div class="mail-box-header">
                <div class="pull-right tooltip-demo">
                    @*<a href="@Url.Action("Inbox", "Mailbox")" class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top" title="Move to draft folder"><i class="fa fa-pencil"></i> Draft</a>*@
                    <a href="@Url.Action("Index", "Emails")" class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="Discard email"><i class="fa fa-times"></i> 舍弃</a>
                </div>
                <h2>
                    发送电子邮件
                </h2>
            </div>
            <div class="mail-box">



                @using (Ajax.BeginForm("Email", "Admins", null, new AjaxOptions { UpdateTargetId = "box" }, new { @class = "form-horizontal" }))
                {
                    <div class="mail-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">收件人:</label>

                            <div class="col-sm-10"><input type="email" name="address" class="form-control" placeholder="请正确填写邮箱地址" ></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">主题:</label>
                            <input type="hidden" name="neirong" id="neirong" value="" />
                            <div class="col-sm-10"><input type="text" name="zhuti" class="form-control" value=""></div>
                        </div>

                    </div>

                    <div class="mail-text h-200">

                        <div class="summernote">
                            

                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="mail-body text-right tooltip-demo">
                        <button type="submit" id="btn" class="btn btn-sm btn-primary">发送</button>
                        @*<a href="@Url.Action("Inbox", "Mailbox")" class="btn btn-sm btn-primary" data-toggle="tooltip" data-placement="top" title="Send"><i class="fa fa-reply"></i> Send</a>*@
                        <a href="@Url.Action("Index", "Emails")" class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top" title="Discard email"><i class="fa fa-times"></i> 舍弃</a>
                        @*<a href="@Url.Action("Inbox", "Mailbox")" class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top" title="Move to draft folder"><i class="fa fa-pencil"></i> Draft</a>*@
                    </div>
                }
                <div class="clearfix alert alert-success" id="box" ></div>



            </div>
        </div>
    </div>
</div>

@*@section Styles {
    @Styles.Render("~/plugins/summernoteStyles")
}*@

@section Scripts {
    @Scripts.Render("~/plugins/summernote")
    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            $('.summernote').summernote({
height: 200
});
             
            $("form").submit(function (e) {
                $("#neirong").val(encodeURI($('.summernote').summernote('code')));
            });



        });


    </script>
}